package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.AutoReplyMapper;
import org.linlinjava.litemall.db.domain.AutoReply;
import org.linlinjava.litemall.db.domain.AutoReplyExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description:
 * @program: mall
 * @author: youvy
 * @create: 2019-12-14 10:12
 **/
@Service
public class AutoReplyService {
	@Resource
	private AutoReplyMapper autoReplyMapper;

	public List<AutoReply> getReplyByType(int imid,int type){
		AutoReplyExample example = new AutoReplyExample();
		example.or().andImIdEqualTo(imid).andTypeEqualTo(type);
		return autoReplyMapper.selectByExampleSelective(example);
	}
	public int insert(AutoReply autoReply){
		return autoReplyMapper.insertSelective(autoReply);
	}
	public int delete(int id){
		return autoReplyMapper.deleteByPrimaryKey(id);
	}
	public int update(AutoReply autoReply){
		return autoReplyMapper.updateByPrimaryKeySelective(autoReply);
	}
}
